<template>

  <div>
    <div>
      <van-field v-model='car_number' placeholder='请输入车牌号'></van-field>
      <van-button @click='getCarRecord'>查询</van-button>

    </div>

    <table>
      <tr>
        <td>车牌号</td>
        <td>进入时间</td>
        <td>离开时间</td>
        <!-- <td>操作</td> -->
      </tr>
      <tr
        v-for='i in list'
        :key="i.index"
      >
        <td>{{i.car}}</td>
        <td>{{i.in_time}}</td>
        <td>{{i.out_time}}</td>
        <!-- <td>
          <van-button @click='out(i.car)'>离开</van-button>
        </td> -->
      </tr>
    </table>
  </div>

</template>



<script>
import { get_car_data } from "@/components/axios_api/api.js"; // @符号指的是src路径
import { get_car_record } from "./axios_api/api";
export default {
  data() {
    return {
      car_number: "",
      list: [],
      name: "",
    };
  },
  methods: {
    // 获取车辆信息
    getCarData() {
      let data = { car_number: this.car_number };
      get_car_data(data).then((res) => {
        if (res.code == 200) {
          this.name = res.name;
        } else {
          alert("数据错误");
        }
      });
    },
    
  mounted() {
  
  },
};
</script>

<style>

</style>